﻿@{
    Layout = null;
    
     List<EnterpriseFund.Model.TaxClassAllowance> taxClassAllowanceList =  ViewData["taxClassAllowanceList"]==null?new List<EnterpriseFund.Model.TaxClassAllowance>(): ViewData["taxClassAllowanceList"] as List<EnterpriseFund.Model.TaxClassAllowance>;
     int sum = taxClassAllowanceList.Count + 1;
     System.Data.DataTable showData = ViewData["showData"] == null ? new System.Data.DataTable() : ViewData["showData"] as System.Data.DataTable;
     }

<!DOCTYPE html>
 
<html>
@Html.Partial("LoadPanelPartial")
<head>
    <title>JSummarySheet</title>
      @if (false)
       {
        <script src="../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
       }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <link href="@Url.Content("~/Content/jquery-ui.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery-ui.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
   
    @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme }
)
    @Html.DevExpress().GetScripts(
        new Script { ExtensionType = ExtensionType.ListBox }
)
 <style>
    .tableStyle
{
	width: 100%;
	border: solid 1px black;
		padding: 6px 5px;
	border-collapse: collapse;
}
.tableStyle td
{
}

.tableStyle .tdClass
{
	padding: 0px;
  padding: 6px 5px;
	border: solid 1px black;
	white-space: nowrap;
}
.tableStyle th
{
	text-align: right;
	padding: 6px 5px;
	border: solid 1px black;
}
.tableStyle .button
{
	margin: 2px 0px 0px 2px;
	float: left;
}

text{border:1px solid #aecaf0;}

    </style>
    <script>
        var pre;
        function selectArow(sObject) {
            $(sObject).attr("style", "BACKGROUND-COLOR: #e0f2ff");
            if (pre != null && pre != sObject) {
                $(pre).attr("style", "BACKGROUND-COLOR: white");
            }
            pre = sObject;
        }
</script>
</head>
<body>

      <table width="100%">
    <tr onclick="selectArow(this)">
    <td align="center">
    <h1>@ViewData["year"]年度企业增收贡献奖计算表</h1>
    </td>
    <td>
    </td>
    </tr onclick="selectArow(this)">
    <tr >
    <td align="center">
    制表日期：@DateTime.Now.ToString("yyyy年MM月dd日")
    </td>
      
    </tr>
    </table>
     
    <table class="tableStyle">
    <tr onclick="selectArow(this)">
    <td rowspan='2' class="tdClass" align="center">序号</td>
    <td rowspan='2' class="tdClass" align="center">纳税编码</td>
    <td rowspan='2' class="tdClass" align="center">企业名称</td>
    <td colspan='@sum' class="tdClass" align="center">@ViewData["year"]</td>
    <td colspan='@sum' class="tdClass" align="center">@ViewData["Syear"]</td>
    <td rowspan='2' class="tdClass" align="center">合计增加额(元)</td>
    </tr>
    <tr  onclick="selectArow(this)">
        @foreach (EnterpriseFund.Model.TaxClassAllowance t in taxClassAllowanceList)
        {
            <td class="tdClass" align="center">@t.FTaxClassAllowanceName</td>
        }
            <td class="tdClass" align="center">合计</td>
                @foreach (EnterpriseFund.Model.TaxClassAllowance t in taxClassAllowanceList)
        {
            <td class="tdClass" align="center">@t.FTaxClassAllowanceName</td>
        }
      <td class="tdClass" align="center">合计</td>
    </tr>
    @for (int i = 0; i < showData.Rows.Count; i++)
    {
        <tr  onclick="selectArow(this)">
        @foreach (System.Data.DataColumn dc in showData.Columns)
        {
            decimal d = 0;
            if (decimal.TryParse(showData.Rows[i][dc.ColumnName].ToString(), out d))
            {
                if (d == 0)
                {
                      <td class="tdClass" align="right"></td> 
                }
                else
                {
                    if(dc.ColumnName=="xh")
                    {
                         <td class="tdClass" align="center">@showData.Rows[i][dc.ColumnName]</td> 
                    }
                    else
                    {
                  <td class="tdClass" align="right">@showData.Rows[i][dc.ColumnName]</td> 
                    }
                }
            }
            else
            {
                if (dc.ColumnName == "NSRMC")
                {
                    <td class="tdClass" align="left">@showData.Rows[i][dc.ColumnName]</td> 
                }
                else
                {
                      <td class="tdClass" align="center">@showData.Rows[i][dc.ColumnName]</td> 
                }
            }
        }
        </tr> 
    }
    </table>
     
 
</body>
</html>
